#pragma once
#include "Headers.h"
#include "VectorProperties.h"


namespace particleEditorCli{

public ref class ParticleAffectorProperties
{
	ParticleAffector* mAffector;
	Vector3dProperties^ m_Position;
	Vector3dProperties^ m_Direction;
public:
	ParticleAffectorProperties(ParticleAffector* affector)
	{
		mAffector = affector;
		
		m_Position=gcnew Vector3dProperties();
		m_Direction=gcnew Vector3dProperties();
		
	}	
};

public ref class ParticleEmitterProperties
{
	ParticleEmitter* mEmitter;
	Vector3dProperties^ m_Position;
	Vector3dProperties^ m_Direction;

public:
	ParticleEmitterProperties(ParticleEmitter* emitter)
	{
		mEmitter = emitter;
		
		m_Position=gcnew Vector3dProperties();
		m_Direction=gcnew Vector3dProperties();
		
		/*emitter->totalTimeToLive
		emitter->timeToLive
		emitter->rotationSpeed
		emitter->rotation
		emitter->position
		emitter->particleType
		emitter->mHeight
		emitter->mWidth
		emitter->direction
		emitter->colour*/

	}

	~ParticleEmitterProperties()
	{

	}

	[	Browsable(true),
		DescriptionAttribute("Position"),
		RefreshProperties(RefreshProperties::All),
		NotifyParentProperty(true),
		EditorBrowsable(EditorBrowsableState::Advanced)]

	property Vector3dProperties^ Position
	{
		Vector3dProperties^ get()
		{
			m_Position->X = mEmitter->position.x;
			m_Position->Y = mEmitter->position.y;
			m_Position->Z = mEmitter->position.z;
			return m_Position;
		}
		void set(Vector3dProperties^ value)
		{
			mEmitter->position = Vector3(value->X,value->Y,value->Z);
		}
	}


	[	Browsable(true),
		DescriptionAttribute("Position"),
		RefreshProperties(RefreshProperties::All),
		NotifyParentProperty(true),
		EditorBrowsable(EditorBrowsableState::Advanced)]

	property Vector3dProperties^ Direction
	{
		Vector3dProperties^ get()
		{
			m_Direction->X = mEmitter->direction.x;
			m_Direction->Y = mEmitter->direction.y;
			m_Direction->Z = mEmitter->direction.z;
			return m_Direction;
		}
		void set(Vector3dProperties^ value)
		{
			mEmitter->direction = Vector3(value->X,value->Y,value->Z);
		}
	}

	

	property float Height
	{
		float get()
		{
			return mEmitter->mHeight;
		}
		void set(float value)
		{
			mEmitter->mHeight = value;
		}
	}

	property float Width
	{
		float get()
		{
			return mEmitter->mWidth;
		}
		void set(float value)
		{
			mEmitter->mWidth = value;
		}
	}

	property float RotationSpeed
	{
		float get()
		{
			return mEmitter->rotationSpeed.valueRadians();
		}
		void set(float value)
		{
			mEmitter->rotationSpeed = Radian(value);
		}
	}

	property float TimeToLive
	{
		float get()
		{
			return mEmitter->timeToLive;
		}
		void set(float value)
		{
			mEmitter->timeToLive = value;
		}
	}

	property float TotalTimeToLive
	{
		float get()
		{
			return mEmitter->totalTimeToLive;
		}
		void set(float value)
		{
			mEmitter->totalTimeToLive = value;
		}
	}

};

public ref class ParticleProperties
{
	Particle* mParticle;
	Vector3dProperties^ m_Position;
	Vector3dProperties^ m_Direction;

	ParticleEmitterProperties^ mEmitterProperties;

public:
	ParticleProperties(Particle* particle)
	{
		mParticle = particle;
		m_Position=gcnew Vector3dProperties();
		m_Direction=gcnew Vector3dProperties();
		
	}
	
	~ParticleProperties()
	{
		//mParticle->totalTimeToLive
		//mParticle->timeToLive
		//mParticle->rotationSpeed
		//mParticle->mWidth
		//mParticle->mHeight

		/*mParticle->mOwnDimensions
		mParticle->rotation
		mParticle->position
		mParticle->particleType
		mParticle->direction
		mParticle->colour */
	}
	
	[	Browsable(true),
		DescriptionAttribute("Position"),
		RefreshProperties(RefreshProperties::All),
		NotifyParentProperty(true),
		EditorBrowsable(EditorBrowsableState::Advanced)]

	property Vector3dProperties^ Position
	{
		Vector3dProperties^ get()
		{
			m_Position->X=mParticle->position.x;
			m_Position->Y=mParticle->position.y;
			m_Position->Z=mParticle->position.z;
			return m_Position;
		}
		void set(Vector3dProperties^ value)
		{
			mParticle->position = Vector3(value->X,value->Y,value->Z);
		}
	}


	[	Browsable(true),
		DescriptionAttribute("Position"),
		RefreshProperties(RefreshProperties::All),
		NotifyParentProperty(true),
		EditorBrowsable(EditorBrowsableState::Advanced)]

	property Vector3dProperties^ Direction
	{
		Vector3dProperties^ get()
		{
			m_Direction->X=mParticle->direction.x;
			m_Direction->Y=mParticle->direction.y;
			m_Direction->Z=mParticle->direction.z;
			return m_Direction;
		}
		void set(Vector3dProperties^ value)
		{
			mParticle->direction = Vector3(value->X,value->Y,value->Z);
		}
	}

	

	property float Height
	{
		float get()
		{
			return mParticle->mHeight;
		}
		void set(float value)
		{
			mParticle->mHeight = value;
		}
	}

	property float Width
	{
		float get()
		{
			return mParticle->mWidth;
		}
		void set(float value)
		{
			mParticle->mWidth = value;
		}
	}

	property float RotationSpeed
	{
		float get()
		{
			return mParticle->rotationSpeed.valueRadians();
		}
		void set(float value)
		{
			mParticle->rotationSpeed = Radian(value);
		}
	}

	property float TimeToLive
	{
		float get()
		{
			return mParticle->timeToLive;
		}
		void set(float value)
		{
			mParticle->timeToLive = value;
		}
	}

	property float TotalTimeToLive
	{
		float get()
		{
			return mParticle->totalTimeToLive;
		}
		void set(float value)
		{
			mParticle->totalTimeToLive = value;
		}
	}
};

}